/**
 * leave
 * ibio-develop
 */
(function(){
var m_data = {};
chrome.extension.sendMessage({type:"getData", key:KEY_HE_DATA}, init);

trace("leave_happyelements_net controller", getPara(location.href, "controller"));
trace("leave_happyelements_net action", getPara(location.href, "action"));

function init(result){
	m_data = result;
	trace("leave_happyelements_net data", m_data);
	if(m_data.isWorking){
		if(getPara(location.href, "controller") == "application"){
			//
			switch(getPara(location.href, "action")){
				case "add":
					chrome.extension.sendMessage({type:"loadContents", list:["contents/leave/" + getPara(location.href, "action")]});
					break;
				default:
					gotoNextPage();
			}
		}else{
			gotoNextPage();
		}
	}
}

function gotoNextPage(){
	//goto unique id
	location.href = URL_GET_UNIQUE_ID;
}

}).call(this);